package com.ean.backpack.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ean.backpack.domain.Parentregionlist;
import com.ean.backpack.repository.ParentregionlistRepository;
import com.ean.backpack.service.ParentregionlistService;

@Service
@Transactional
public class ParentregionlistServiceImpl implements ParentregionlistService {

	@Autowired
	ParentregionlistRepository parentregionlistRepository;

	public long countAllParentregionlists() {
		return parentregionlistRepository.count();
	}

	public void deleteParentregionlist(Parentregionlist parentregionlist) {
		parentregionlistRepository.delete(parentregionlist);
	}

	public Parentregionlist findParentregionlist(Integer id) {
		return parentregionlistRepository.findOne(id);
	}

	public List<Parentregionlist> findAllParentregionlists() {
		return parentregionlistRepository.findAll();
	}

	public List<Parentregionlist> findParentregionlistEntries(int firstResult,
			int maxResults) {
		return parentregionlistRepository.findAll(
				new org.springframework.data.domain.PageRequest(firstResult
						/ maxResults, maxResults)).getContent();
	}

	public void saveParentregionlist(Parentregionlist parentregionlist) {
		parentregionlistRepository.save(parentregionlist);
	}

	public Parentregionlist updateParentregionlist(
			Parentregionlist parentregionlist) {
		return parentregionlistRepository.save(parentregionlist);
	}
}
